package com.whw.springboot.walk.controller;

import com.whw.springboot.walk.entity.LessonApply;
import com.whw.springboot.walk.entity.Message;
import com.whw.springboot.walk.service.LessonApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "申请旁听模块")
@RestController
@RequestMapping("/api/lessonApply")
public class LessonApplyController {

    @Resource
    private LessonApplyService lessonApplyService;

    @ApiOperation(value = "小程序预约旁听课程")
    @PostMapping(value = "/addLessonApply")
    public Message addLessonApply(LessonApply lessonApply){
        return lessonApplyService.addLessonApply(lessonApply);
    }


    @ApiOperation(value = "根据用户编号查看所有预约课程")
    @GetMapping(value = "/selectLessonByUserId")
    public Message<List<LessonApply>> selectLessonByUserId(String userId){
        return lessonApplyService.selectLessonByUserId(userId);
    }



}
